{% extends 'base.html' %}

{% block content %}
<div class="container mt-4">
    <h2>创建新群聊</h2>
    <form method="POST" action="{{ url_for('create_group') }}">
        <div class="mb-3">
            <label for="name" class="form-label">群聊名称</label>
            <input type="text" class="form-control" id="name" name="name" required>
            {% with messages = get_flashed_messages() %}
                {% if messages %}
                    <div class="invalid-feedback" style="display: block;">
                        {{ messages[0] }}
                    </div>
                {% endif %}
            {% endwith %}
        </div>
        <button type="submit" class="btn btn-primary">创建群聊</button>
        <a href="{{ url_for('my_groups') }}" class="btn btn-secondary">返回</a>
    </form>
</div>
{% endblock %}
